<!DOCTYPE html>
<html lang="en">
<head>
    <title>添加内容</title>
    <script src="/admin/js/jquery.min.js?v=2.1.4"></script>
    <link rel="stylesheet" type="text/css" href="/admin/js/simditor-2.3.6/styles/simditor.css" />
    <script type="text/javascript" src="/admin/js/simditor-2.3.6/scripts/module.js"></script>
    <script type="text/javascript" src="/admin/js/simditor-2.3.6/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="/admin/js/simditor-2.3.6/scripts/uploader.js"></script>
    <script type="text/javascript" src="/admin/js/simditor-2.3.6/scripts/simditor.js"></script>
</head>
<body class="fixed-left">
<div id="wrapper">
    <#include "../header.html">
        <div class="content-page">
            <div class="content">
                <div class="container">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="panel panel-color panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">添加内容</h3>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" role="form" id="global-form" action="/admin/news/doAdd" method="post" enctype="multipart/form-data">
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">分类</label>
                                            <div class="col-md-9">
                                               <select name="cateid">
                                                   <option value="0">请选择</option>
                                                   <#list data as cate>
                                                   <option value="${cate.id}">${cate.name}</option>
                                                   </#list>
                                               </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">标题</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="title" placeholder="标题"
                                                       value="" required="required" aria-required="true"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">缩略图</label>
                                            <div class="col-md-9">
                                                <input type="file"  name="thumb" placeholder="缩略图"
                                                       value=""/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">关键词</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="keywords" placeholder="关键词"
                                                       value="" required="required" aria-required="true"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">摘要</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="description" placeholder="摘要"
                                                       value="" required="required" aria-required="true"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">内容</label>
                                            <div class="col-md-9">
                                                <textarea id="editor" name="content" class="form-control"></textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">排序</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="order" placeholder="排序"
                                                       value="1" required="required" aria-required="true"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">状态</label>
                                            <div class="col-md-9">
                                                <input type="radio" name="status" value="1" checked>未发布
                                                <input type="radio" name="status" value="2">已发布
                                            </div>
                                        </div>


                                        <input type="hidden" name="allow_install" id="allow_install"/>
                                        <div class="clearfix pull-right">
                                            <input type="submit" class="btn btn-primary waves-effect waves-light" value="保存" name="保存" />
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>



                    </div>
                </div>
            </div>
        </div>
</div>
<#include "../footer.html">
    <script type="text/javascript">
        var editor;
        $(document).ready(function () {
            editor = new Simditor({
                textarea: $('#editor'),
                pasteImage: true,//允许粘贴图片
                upload:{
                    url: '/upload/image',
                    params: null,
                    fileKey: 'upload_file',
                    connectionCount: 3,
                    leaveConfirm: '图片正在上传中，是否真的离开此页?'
                },
                toolbar: ['title','bold','italic','underline','strikethrough','fontScale','color','ol' ,'ul','blockquote','code','table','link','image','hr','indent','outdent','alignment']
            });
            editor.focus();
        });
    </script>
</body>
</html>